<%@page import="dal.employee.EmployeeUtil"%>
<%@page import="java.util.ArrayList"%>
<%@page import="dal.employee.Employee"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ViewById Employee</title>
</head>
<body>
	<%
	try{
		/* ArrayList<Object> al = (ArrayList) session.getAttribute("al"); */
		ArrayList<Object> al=new EmployeeUtil().get();
		if(al.size()>0){
		
	%>
			<table>
				<tr>
					<th>Employee Id</th>
					<th>Name</th>
					<th>Current Address</th>
					<th>Permanent Address</th>
					<th>Mobile</th>
					<th>Email Id</th>
					<th>Alternative Email_id</th>
					<th>Designation</th>
					<th>Date Added</th>
				</tr>
		
				<%
					for (Object ob : al) {
						Employee employee = (Employee) ob;
				%>
				<tr>
					<td><%=employee.getEmployeeId()%></td>
					<td><%=employee.getName()%></td>
					<td><%=employee.getCurrentAddress()%></td>
					<td><%=employee.getPermenentAddress()%></td>
					<td><%=employee.getMobile()%></td>
					<td><%=employee.getEmailId()%></td>
					<td><%=employee.getAlternateEmailId()%></td>
					<td><%=employee.getDesignation()%></td>
					<td><%=employee.getDateAdded()%></td>
				</tr>
				<%
					}
				%>
			</table>
		<%
		}else{
		%>
			<b><font style="color: red;">Sorry ! No records found</font></b>
		<%
		}
	}catch(Exception e){
	%>
		<b><font style="color: red;">Sorry ! Error while retrieving records</font></b>
	<%
	}	
		 %>	
</body>
</html>